package com.robot.base.common.api;

import com.robot.base.model.BannerBean;
import com.robot.base.model.CheckMobileBindThirdUidBean;
import com.robot.base.model.CustomListBean;
import com.robot.base.model.CustomProfileBean;
import com.robot.base.model.ExamineBean;
import com.robot.base.model.GroupAddBean;
import com.robot.base.model.LoginBean;
import com.robot.base.model.MyFriendBean;
import com.robot.base.model.NoticeBean;
import com.robot.base.model.QxsxDataBean;
import com.robot.base.model.RefreshTokenBean;
import com.robot.base.model.SignGroupBean;
import com.robot.base.model.UserInfoBean;
import com.qihang.annotations.ApiFactory;
import com.robot.base.model.WagesBean;
import com.robot.base.model.WagesDetailBean;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import me.goldze.mvvmhabit.http.BaseResponse;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Streaming;
import retrofit2.http.Url;

@ApiFactory(value = GlBaseApi.class)
public interface UserService {

    //发送短信验证码
    @FormUrlEncoded
    @POST("front/app/get/code")
    Observable<BaseResponse<String>> sendSmsVerifyCode(@FieldMap Map<String, Object> map);

    /**
     * 找回密码
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/find/psd")
    Observable<BaseResponse<String>> findPsd(@FieldMap Map<String, Object> map);

    @Streaming
    @GET
    Observable<ResponseBody> dowloadApk(@Url String url);

    @POST("front/app/template/whole/custom/list")
    Observable<BaseResponse<CustomListBean>> customList();


    @POST("front/app/get/whole/user")
    Observable<BaseResponse<UserInfoBean>> getUser();

    /**
     * 获取动态申请模板详情
     *
     * @param map
     * @return
     */
    @POST("front/app/template/whole/custom/info")
    Observable<BaseResponse<CustomProfileBean>> customInfo(@Body Map<String, Object> map);

    @POST("front/app/login")
    Observable<BaseResponse<LoginBean>> login(@Body Map<String, Object> map);

    /**
     * 获取固定申请动态参数与审批
     *
     * @param map 模板类型：考勤【1请假申请；2加班申请；3外勤申请；4补卡申请；】，
     *            人事【5转正申请；6调薪申请；7权限申请；8离职申请】，
     *            行政【9资料申请；10用印申请；11工序审批申请；12合同审批申请】，
     *            财务【13报销申请；14开票申请；15财务审核申请；16劳务结算申请；
     *            17工会经费申请；18薪酬绩效申请】
     * @return
     */
    @POST("front/app/template/trends/get/data")
    Observable<BaseResponse<CustomProfileBean>> templateTrendsGetData(@Body Map<String, String> map);

    /**
     * 用户申请动态模板操作
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/template/whole/custom/add")
    Observable<BaseResponse<String>> templateWholeCustomAdd(@FieldMap Map<String, Object> map);

    /**
     * 用户请假申请
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/template/ask/user/add")
    Observable<BaseResponse<String>> templateAskUserAdd(@FieldMap Map<String, Object> map);

    /**
     * 用户加班申请
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/template/shift/user/add")
    Observable<BaseResponse<String>> templateShiftUserAdd(@FieldMap Map<String, Object> map);

    /**
     * 用户外勤申请
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/template/field/user/add")
    Observable<BaseResponse<String>> templateFieldUserAdd(@FieldMap Map<String, Object> map);

    /**
     * 用户补卡申请
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/template/card/user/add")
    Observable<BaseResponse<String>> templateCardUserAdd(@FieldMap Map<String, Object> map);

    /**
     * 用户转正申请
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/template/become/user/add")
    Observable<BaseResponse<String>> templateBecomeUserAdd(@FieldMap Map<String, Object> map);

    /**
     * 用户调薪申请
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/template/raise/user/add")
    Observable<BaseResponse<String>> templateRaiseUserAdd(@FieldMap Map<String, Object> map);

    /**
     * 用户权限申请
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/template/authority/user/add")
    Observable<BaseResponse<String>> templateAuthorityUserAdd(@FieldMap Map<String, Object> map);

    /**
     * 用户离职申请
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/template/depart/user/add")
    Observable<BaseResponse<String>> templateDepartUserAdd(@FieldMap Map<String, Object> map);

    /**
     * 用户资料申请
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/template/information/user/add")
    Observable<BaseResponse<String>> templateInformationUserAdd(@FieldMap Map<String, Object> map);

    /**
     * 用户用印申请
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/template/seal/user/add")
    Observable<BaseResponse<String>> templateSealUserAdd(@FieldMap Map<String, Object> map);

    /**
     * 用户工序审批申请
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/template/process/user/add")
    Observable<BaseResponse<String>> templateProcessUserAdd(@FieldMap Map<String, Object> map);

    /**
     * 用户合同审批申请
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/template/covenant/user/add")
    Observable<BaseResponse<String>> templateCovenantUserAdd(@FieldMap Map<String, Object> map);

    /**
     * 用户报销申请
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/template/expense/user/add")
    Observable<BaseResponse<String>> templateExpenseUserAdd(@FieldMap Map<String, Object> map);

    /**
     * 用户开票申请
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/template/invoicing/user/add")
    Observable<BaseResponse<String>> templateInvoicingUserAdd(@FieldMap Map<String, Object> map);

    /**
     * 用户财务审核申请
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/template/treasurer/user/add")
    Observable<BaseResponse<String>> templateTreasurerUserAdd(@FieldMap Map<String, Object> map);

    /**
     * 用户劳务结算申请
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/template/labor/user/add")
    Observable<BaseResponse<String>> templateLaborUserAdd(@FieldMap Map<String, Object> map);

    /**
     * 用户工会经费申请
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/template/trade/user/add")
    Observable<BaseResponse<String>> templateTradeUserAdd(@FieldMap Map<String, Object> map);

    /**
     * 用户薪酬绩效申请
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/template/salary/user/add")
    Observable<BaseResponse<String>> templateSalaryUserAdd(@FieldMap Map<String, Object> map);


    /**
     * 审批列表
     *
     * @param type 1待审批；2已审批
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/examine/user/data")
    Observable<BaseResponse<List<ExamineBean>>> examineUserData(@Field("type") String type);

    /**
     * 获取审批详情
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/examine/user/info")
    Observable<BaseResponse<CustomProfileBean>> examineUserInfo(@FieldMap Map<String, Object> map);

    /**
     * 用户审批操作
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/examine/user/verify")
    Observable<BaseResponse<String>> examineUserVerify(@FieldMap Map<String, Object> map);

    /**
     * 获取我的申请列表
     *
     * @param type 1待审批；2已审批
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/my/apply/data")
    Observable<BaseResponse<List<ExamineBean>>> applyUserData(@Field("type") String type);

    @FormUrlEncoded
    @POST("front/app/examine/user/revoke")
    Observable<BaseResponse<String>> examineUserRevoke(@FieldMap Map<String, Object> map);

    /**
     * 获取我的申请详情
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/my/apply/info")
    Observable<BaseResponse<CustomProfileBean>> applyUserInfo(@FieldMap Map<String, Object> map);

    /**
     * 我的工资列表
     *
     * @return
     */
    @POST("front/app/get/user/wages/list")
    Observable<BaseResponse<List<WagesBean>>> getUserWagesList();


    /**
     * 考勤工资详情
     *
     * @return
     */
    @FormUrlEncoded
    @POST("backend/api/finance/wages/generate/info")
    Observable<BaseResponse<WagesDetailBean>> wagesGenerateInfo(@Field("id") String id);

    /**
     * 我的消息列表
     *
     * @return
     */
    @POST("front/app/get/user/message/notice")
    Observable<BaseResponse<List<NoticeBean>>> getUserMessageNotice();

    /**
     * 消息标记已读
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/user/message/notice/edit")
    Observable<BaseResponse<String>> userMessageNoticeEdit(@FieldMap Map<String, Object> map);

    /**
     * banner
     *
     * @return
     */
    @POST("front/app/get/banner")
    Observable<BaseResponse<List<BannerBean>>> banner();

    /**
     * banner
     *
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/attendance/get/group")
    Observable<BaseResponse<SignGroupBean>> attendanceGetGroup(@FieldMap Map<String, Object> map);

    /**
     * 获取权限申请所需的权限
     *
     * @return
     */
    @POST("front/app/template/qxsx/menu/data")
    Observable<BaseResponse<List<QxsxDataBean>>> templateQxsxMenuData();

    @FormUrlEncoded
    @POST("front/app/attendance/user/dk")
    Observable<BaseResponse<Object>> userDk(@FieldMap Map<String, Object> map);

    @FormUrlEncoded
    @POST("front/app/ryim/get/whole/user")
    Observable<BaseResponse<List<UserInfoBean>>> fetchFriend(@FieldMap Map<String, Object> map);

    @POST("front/app/ryim/wdhy/list")
    Observable<BaseResponse<List<MyFriendBean>>> myFriend();

    @FormUrlEncoded
    @POST("front/app/ryim/wdhy/add")
    Observable<BaseResponse<Object>> addFriend(@FieldMap Map<String, Object> map);
    /**
     * 创建群组
     *
     * @param title
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/ryim/group/add")
    Observable<BaseResponse<Object>> ryimGroupAdd(@Field("title") String title);

    /**
     * 获取能加入的群列表
     *
     * @return
     */
    @POST("front/app/ryim/get/group/data")
    Observable<BaseResponse<List<GroupAddBean>>> ryimGetGroupData();

    /**
     * 用户加入群组
     *
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/ryim/group/user/join")
    Observable<BaseResponse<String>> ryimGroupUserJoin(@Field("id") String id);

    /**
     * 群组列表
     * @param type
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/ryim/group/list")
    Observable<BaseResponse<List<GroupAddBean>>> ryimGroupList(@Field(("type")) String type);

    /**
     * 解散群组
     * @param id
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/ryim/group/del")
    Observable<BaseResponse<String>> ryimGroupDel(@Field("id") String id);

    /**
     * 用户退出群组
     * @param id
     * @return
     */
    @FormUrlEncoded
    @POST("front/app/ryim/group/user/out")
    Observable<BaseResponse<String>> ryimGroupUserOut(@Field("id") String id);
}
